# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=kdepim-addons
pkgver=20.04.3
pkgrel=0
arch="all !ppc64le !s390x !armhf !mips !mips64" # Limited by kdepim-addons -> kmailtransport -> libkgapi -> qt5-qtwebengine
url="https://kontact.kde.org/"
pkgdesc="Addons for KDE PIM applications"
license="GPL-2.0-or-later AND LGPL-2.0-or-later"
makedepends="extra-cmake-modules qt5-qtbase-dev qt5-qtwebengine-dev ki18n-dev kconfig-dev kdbusaddons-dev akonadi-notes-dev kxmlgui-dev kdeclarative-dev syntax-highlighting-dev kio-dev kiconthemes-dev kparts-dev prison-dev kholidays-dev kcalendarcore-dev kcalutils-dev mailcommon-dev grantlee-dev messagelib-dev libkleo-dev grantleetheme-dev pimcommon-dev libkdepim-dev incidenceeditor-dev akonadi-dev akonadi-calendar-dev libgravatar-dev kpimtextedit-dev kidentitymanagement-dev kimap-dev libksieve-dev ktnef-dev kmailtransport-dev kcontacts-dev akonadi-contacts-dev mailimporter-dev gpgme-dev discount-dev kpkpass-dev kitinerary-dev akonadi-import-wizard-dev kontactinterface-dev"
checkdepends="xvfb-runi drkonqi"
source="https://download.kde.org/stable/release-service/$pkgver/src/kdepim-addons-$pkgver.tar.xz"
subpackages="$pkgname-lang"
options="!check" # Require OpenGL and running dbus

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DKDEPIMADDONS_BUILD_EXAMPLES=OFF
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}

sha512sums="faf986a08339452c7f3bd7e46b438ed31780332756b23eb5fe58c3c0325b21694fd1bf462eca7f0b4c463df056d42aefdc9db16905ce1e79a6df3cd0f26e3d87  kdepim-addons-20.04.3.tar.xz"
